#include "TestData.h"

IndexVector* shuffle(size_t size) {
	IndexVector* vectorPtr = new IndexVector(size,0);
	IndexVector& vector = *vectorPtr;
	IndexVector freeIds;
	freeIds.reserve(size);

	for(unsigned int i=0; i<size; ++i) {
		freeIds.push_back(i);
	}

	for(unsigned int i=0; i<size; ++i) {
		unsigned int randomIndex = rand() % (size-i);
		vector[i] = freeIds[randomIndex];
		freeIds.erase(freeIds.begin() + randomIndex);
	}

	return vectorPtr;
}